构造字符串
string one("shenjun");
cout << one << endl;
printf("name : %s\n", one.data());
printf("name : %s\n", one.c_str());
char n[10];
one.copy(n, one.length());
*(n+one.length()) = '\0';
printf("name = %s\n", n);
string two(20, '$');
cout << two << endl;
string three(one);
cout << three << endl;
one += "OOP!";
cout << one << endl;
two = "Sorry! That was ";
cout << two << endl;
three[0] = 'S';
cout << three << endl;
string four;
four = two + three;
cout << four << endl;
char alls[] = "All's well that ends well";
string five (alls, 20);
cout << five << endl;
string six(alls + 6, alls + 10);
cout << six << endl;
string seven(&five[6], &five[10]);
cout << seven << endl;
string eight("12345678901234567890123", 7, 3);
cout << eight << endl;